#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

#define ElementType void*

typedef struct DynamicArray 
{
    ElementType *dp;
    int len;
    int size;
    bool (*InsertArrayTail)(DArray *a,ElementType element);
    bool (*RemoveByElement)(DArray *a,ElementType element,bool (*funcPtr)(ElementType,ElementType),void (ClearPtr)(ElementType));

    DArray (*FindElement)(DArray *a, void *element,bool (*funcPtr)(ElementType,ElementType));
    void (*DisplayDynamicArray)(DArray *a,void (*funcPtr)(ElementType));
    bool (*Sort)(DArray *a,bool (*funcPtr)(ElementType,ElementType));
    void (*ClearDArray)(DArray *a, void (*funcPtr)(ElementType));

}DArray;

void InitDynamicArray(DArray *a);
